interface Todo {
  title: string;
  completed: boolean;
  description: string;
  add(): number;
  del(): number;
  upt(): number;
}

type Test1 = "do";
type TestCap = Capitalize<Test1>;

// 获取Todo函数
type Degree<T extends Record<string, any>> = {
  // [P in keyof T as T[P] extends Function ? P : never]: T[P];
  [P in keyof T as T[P] extends Function
    ? `do${Capitalize<P & string>}`
    : never]: T[P];
};

type Test = Degree<Todo>;

export {};
